package gimys;

import java.util.ArrayList;
import java.util.Random;

import org.newdawn.slick.SlickException;

public class SolidLoader {

	ArrayList<SolidObject> solidObjects;
	/**
	 * Load the Animals
	 *
	 * @author Sly
	 */

	public SolidLoader(ArrayList<SolidObject> pSolidObjects) {
		solidObjects = pSolidObjects;
	}

	public void loadSolids() throws SlickException{
		Random r = new Random();
		for (int i = 0; i < 15; i++) {

			int x = r.nextInt(500) + 300;
			int y = r.nextInt(800) + 20;

			Path pDefaultPath = new Path(new Point(x, y));
			pDefaultPath.addPoint(new Point(x+100, y));
			pDefaultPath.addPoint(new Point(x+100, y+50));
			pDefaultPath.addPoint(new Point(x, y+50));

			Animal.Skin race = Animal.Skin.values()[r.nextInt(4)];
			
			solidObjects.add( new Animal(new Point(x,y), race, pDefaultPath) );

		}
	}


	public ArrayList<SolidObject> getSolidObjects(){
		return solidObjects;
	}
}
